<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<!--
NOTE: Requires Markdown Extra. See http://michelf.ca/projects/php-markdown/extra/
 -->
<p><link href="data:text/css;charset=utf-8,%0A%0Ahtml%2C%20body%2C%20div%2C%20span%2C%20applet%2C%20object%2C%20iframe%2C%20h1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%2C%20p%2C%20blockquote%2C%20pre%2C%20a%2C%20abbr%2C%20acronym%2C%20address%2C%20big%2C%20cite%2C%20code%2C%20del%2C%20dfn%2C%20em%2C%20img%2C%20ins%2C%20kbd%2C%20q%2C%20s%2C%20samp%2C%20small%2C%20strike%2C%20strong%2C%20sub%2C%20sup%2C%20tt%2C%20var%2C%20b%2C%20u%2C%20i%2C%20center%2C%20dl%2C%20dt%2C%20dd%2C%20ol%2C%20ul%2C%20li%2C%20fieldset%2C%20form%2C%20label%2C%20legend%2C%20table%2C%20caption%2C%20tbody%2C%20tfoot%2C%20thead%2C%20tr%2C%20th%2C%20td%2C%20article%2C%20aside%2C%20canvas%2C%20details%2C%20embed%2C%20figure%2C%20figcaption%2C%20footer%2C%20header%2C%20hgroup%2C%20menu%2C%20nav%2C%20output%2C%20ruby%2C%20section%2C%20summary%2C%20time%2C%20mark%2C%20audio%2C%20video%20%7B%0Amargin%3A%200%3B%0Apadding%3A%200%3B%0Aborder%3A%200%3B%0A%7D%0A%0Abody%20%7B%0Afont%2Dfamily%3A%20calibri%2C%20arial%2C%20freesans%2C%20clean%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2011pt%3B%0Aline%2Dheight%3A%201%2E5%3B%0Acolor%3A%20%23000%3B%0Abackground%2Dcolor%3A%20%23fff%3B%0Apadding%3A%2070px%3B%0Amargin%3A%200%20auto%3B%0A%7D%0Abody%3E%2A%3Afirst%2Dchild%20%7B%0Amargin%2Dtop%3A%200%20%21important%3B%0A%7D%0Abody%3E%2A%3Alast%2Dchild%20%7B%0Amargin%2Dbottom%3A%200%20%21important%3B%0A%7D%0A%0Ap%2C%20blockquote%2C%20ul%2C%20ol%2C%20dl%2C%20pre%20%7B%0Amargin%3A%204px%200%3B%0A%7D%0A%0Ah1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%20%7B%0Afont%2Dfamily%3A%20Variable%20Bold%2C%20Calibri%2C%20Helvetica%2C%20arial%2C%20freesans%2C%20clean%2C%20sans%2Dserif%3B%0Amargin%3A%2020px%200%2010px%3B%0Acolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Apadding%3A%200%3B%0Afont%2Dweight%3A%20bold%3B%0A%2Dwebkit%2Dfont%2Dsmoothing%3A%20antialiased%3B%0A%7D%0Ah1%20tt%2C%20h1%20code%2C%20h2%20tt%2C%20h2%20code%2C%20h3%20tt%2C%20h3%20code%2C%20h4%20tt%2C%20h4%20code%2C%20h5%20tt%2C%20h5%20code%2C%20h6%20tt%2C%20h6%20code%20%7B%0Afont%2Dsize%3A%20inherit%3B%0A%7D%0Ah1%20%7B%0Afont%2Dsize%3A%2028px%3B%0Apage%2Dbreak%2Dbefore%3A%20always%3B%0A%7D%0Ah2%20%7B%0Afont%2Dsize%3A%2024px%3B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0A%7D%0Ah3%20%7B%0Afont%2Dsize%3A%2018px%3B%0A%7D%0Ah4%20%7B%0Afont%2Dsize%3A%2016px%3B%0A%7D%0Ah5%20%7B%0Afont%2Dsize%3A%2014px%3B%0A%7D%0Ah6%20%7B%0Acolor%3A%20%23777%3B%0Afont%2Dsize%3A%2014px%3B%0A%7D%0Abody%3Eh2%3Afirst%2Dchild%2C%20body%3Eh1%3Afirst%2Dchild%2C%20body%3Eh1%3Afirst%2Dchild%2Bh2%2C%20body%3Eh3%3Afirst%2Dchild%2C%20body%3Eh4%3Afirst%2Dchild%2C%20body%3Eh5%3Afirst%2Dchild%2C%20body%3Eh6%3Afirst%2Dchild%20%7B%0Amargin%2Dtop%3A%200%3B%0Apadding%2Dtop%3A%200%3B%0A%7D%0Aa%3Afirst%2Dchild%20h1%2C%20a%3Afirst%2Dchild%20h2%2C%20a%3Afirst%2Dchild%20h3%2C%20a%3Afirst%2Dchild%20h4%2C%20a%3Afirst%2Dchild%20h5%2C%20a%3Afirst%2Dchild%20h6%20%7B%0Amargin%2Dtop%3A%200%3B%0Apadding%2Dtop%3A%200%3B%0A%7D%0Ah1%2Bp%2C%20h2%2Bp%2C%20h3%2Bp%2C%20h4%2Bp%2C%20h5%2Bp%2C%20h6%2Bp%20%7B%0Amargin%2Dtop%3A%2010px%3B%0A%7D%0A%0Aa%20%7B%0Acolor%3A%20%234183C4%3B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0Aa%3Ahover%20%7B%0Atext%2Ddecoration%3A%20underline%3B%0A%7D%0A%0Aul%20%7B%0Apadding%2Dleft%3A%2014px%3B%0A%7D%0Aol%20%7B%0Apadding%2Dleft%3A%2022px%3B%0A%7D%0Aul%20li%20%3E%20%3Afirst%2Dchild%2C%20ol%20li%20%3E%20%3Afirst%2Dchild%2C%20ul%20li%20ul%3Afirst%2Dof%2Dtype%2C%20ol%20li%20ol%3Afirst%2Dof%2Dtype%2C%20ul%20li%20ol%3Afirst%2Dof%2Dtype%2C%20ol%20li%20ul%3Afirst%2Dof%2Dtype%20%7B%0Amargin%2Dtop%3A%200px%3B%0A%7D%0Aul%20ul%2C%20ul%20ol%2C%20ol%20ol%2C%20ol%20ul%20%7B%0Amargin%2Dbottom%3A%200%3B%0A%7D%0Adl%20%7B%0Apadding%3A%200%3B%0A%7D%0Adl%20dt%20%7B%0Afont%2Dsize%3A%2014px%3B%0Afont%2Dweight%3A%20bold%3B%0Afont%2Dstyle%3A%20italic%3B%0Apadding%3A%200%3B%0Amargin%3A%2015px%200%205px%3B%0A%7D%0Adl%20dt%3Afirst%2Dchild%20%7B%0Apadding%3A%200%3B%0A%7D%0Adl%20dt%3E%3Afirst%2Dchild%20%7B%0Amargin%2Dtop%3A%200px%3B%0A%7D%0Adl%20dt%3E%3Alast%2Dchild%20%7B%0Amargin%2Dbottom%3A%200px%3B%0A%7D%0Adl%20dd%20%7B%0Amargin%3A%200%200%2015px%3B%0Apadding%3A%200%2015px%3B%0A%7D%0Adl%20dd%3E%3Afirst%2Dchild%20%7B%0Amargin%2Dtop%3A%200px%3B%0A%7D%0Adl%20dd%3E%3Alast%2Dchild%20%7B%0Amargin%2Dbottom%3A%200px%3B%0A%7D%0A%0Apre%2C%20code%2C%20tt%20%7B%0Afont%2Dsize%3A%2013px%3B%0Afont%2Dfamily%3A%20Consolas%2C%20%22Liberation%20Mono%22%2C%20Courier%2C%20monospace%3B%0A%7D%0Acode%2C%20tt%20%7B%0Amargin%3A%200%200px%3B%0Apadding%3A%200px%200px%3B%0Awhite%2Dspace%3A%20nowrap%3B%0Aborder%3A%201px%20solid%20%23eaeaea%3B%0Abackground%2Dcolor%3A%20%23f8f8f8%3B%0Aborder%2Dradius%3A%203px%3B%0A%7D%0Apre%3Ecode%20%7B%0Amargin%3A%200%3B%0Apadding%3A%200%3B%0Awhite%2Dspace%3A%20pre%3B%0Aborder%3A%20none%3B%0Abackground%3A%20transparent%3B%0A%7D%0Apre%20%7B%0Abackground%2Dcolor%3A%20%23f8f8f8%3B%0Aborder%3A%201px%20solid%20%23ccc%3B%0Afont%2Dsize%3A%2013px%3B%0Aline%2Dheight%3A%2019px%3B%0Aoverflow%3A%20auto%3B%0Apadding%3A%206px%2010px%3B%0Aborder%2Dradius%3A%203px%3B%0A%7D%0Apre%20code%2C%20pre%20tt%20%7B%0Abackground%2Dcolor%3A%20transparent%3B%0Aborder%3A%20none%3B%0A%7D%0Akbd%20%7B%0A%2Dmoz%2Dborder%2Dbottom%2Dcolors%3A%20none%3B%0A%2Dmoz%2Dborder%2Dleft%2Dcolors%3A%20none%3B%0A%2Dmoz%2Dborder%2Dright%2Dcolors%3A%20none%3B%0A%2Dmoz%2Dborder%2Dtop%2Dcolors%3A%20none%3B%0Abackground%2Dcolor%3A%20%23DDDDDD%3B%0Abackground%2Dimage%3A%20linear%2Dgradient%28%23F1F1F1%2C%20%23DDDDDD%29%3B%0Abackground%2Drepeat%3A%20repeat%2Dx%3B%0Aborder%2Dcolor%3A%20%23DDDDDD%20%23CCCCCC%20%23CCCCCC%20%23DDDDDD%3B%0Aborder%2Dimage%3A%20none%3B%0Aborder%2Dradius%3A%202px%202px%202px%202px%3B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%2Dwidth%3A%201px%3B%0Afont%2Dfamily%3A%20%22Helvetica%20Neue%22%2CHelvetica%2CArial%2Csans%2Dserif%3B%0Aline%2Dheight%3A%2010px%3B%0Apadding%3A%201px%204px%3B%0A%7D%0A%0Ablockquote%20%7B%0Aborder%2Dleft%3A%204px%20solid%20%23DDD%3B%0Apadding%3A%200%2015px%3B%0Acolor%3A%20%23777%3B%0A%7D%0Ablockquote%3E%3Afirst%2Dchild%20%7B%0Amargin%2Dtop%3A%200px%3B%0A%7D%0Ablockquote%3E%3Alast%2Dchild%20%7B%0Amargin%2Dbottom%3A%200px%3B%0A%7D%0A%0Ahr%20%7B%0Aclear%3A%20both%3B%0Amargin%3A%200%200%3B%0Aheight%3A%200px%3B%0Aoverflow%3A%20hidden%3B%0Aborder%3A%20none%3B%0Abackground%3A%20transparent%3B%0Aborder%2Dbottom%3A%204px%20solid%20%23ddd%3B%0Apadding%3A%200%3B%0A%7D%0A%0Atable%20th%20%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Atable%20th%2C%20table%20td%20%7B%0Apadding%3A%200px%200px%3B%0A%7D%0Atable%20tr%20%7B%0A%7D%0A%0Aimg%20%7B%0Amax%2Dwidth%3A%20100%25%3B%0A%7D%0A%0A%2Etitle%20%7B%0Afont%2Dfamily%3A%20Variable%20Bold%2C%20Calibri%3B%0Afont%2Dsize%3A%2021pt%3B%0Atext%2Dalign%3A%20left%3B%0Aline%2Dheight%3A%201%3B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0A%2EsubTitle%20%7B%0Afont%2Dfamily%3A%20Variable%20Bold%2C%20Calibri%3B%0Afont%2Dsize%3A%2019pt%3B%0Aline%2Dheight%3A%201%3B%0Acolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Atext%2Dalign%3A%20left%3B%0Afont%2Dweight%3A%20bold%3B%0Adisplay%3A%20inline%3B%0A%7D%0A%2Eauthor%0A%7B%0Atext%2Dalign%3A%20center%3B%0Afont%2Dsize%3A%2016pt%3B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0A%2Esidebar%0A%7B%0Abackground%2Dcolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Acolor%3A%20white%3B%0Aline%2Dheight%3A%201%3B%0Apadding%2Dleft%3A%208px%3B%0Apadding%2Dtop%3A%208px%3B%0Apadding%2Dbottom%3A%208px%3B%0Amargin%2Dright%3A%208px%3B%0Amargin%2Dbottom%3A%208px%3B%0A%7D%0A%2Esidebar%20strong%0A%7B%0Abackground%2Dcolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Acolor%3A%20white%3B%0A%7D%0A%2Esidebar%20code%0A%7B%0Abackground%2Dcolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Aborder%3A%200%3B%0Acolor%3A%20white%3B%0A%7D%0A%2Ecolumn%0A%7B%0Awidth%3A%2033%25%3B%0Avertical%2Dalign%3A%20top%3B%0A%7D%0A%2Efooter%0A%7B%0Acolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Aline%2Dheight%3A%201%3B%0A%7D%0A%2Efooter%20a%0A%7B%0Acolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%20%7D%0Aimg%5Bsrc%2A%3D%22logo%2Epng%22%5D%0A%7B%0Aheight%3A%2080px%3B%0A%7D%0Atd%20strong%20%7B%0Acolor%3A%20rgb%28167%2C%2021%2C%200%29%3B%0Adisplay%3A%20inline%2Dblock%3B%0A%7D%0Aimg%5Balt%3D%22logo%22%5D%0A%7B%0Awidth%3A%2030%25%3B%0A%7D%0A" type="text/css" rel="stylesheet" /></p>
<table width="100%">
<tr>
<td class="title">
Coding Guidelines for C# 3.0, 4.0 and 5.0 Cheat Sheet
</td>
<td rowspan="2" style="text-align:right">
<img src="" alt="logo" />
</td>
</tr>
<tr>
<td>
<div class="subTitle">
Design &amp; Maintainability
</div>
(level 1 and 2 only)
</td>
</tr>
</table>
<table width="100%">
<tr>
<td class="column">
<div class="sidebar" markdown="1">
<p><strong>Basic Principles</strong></p>
<ul>
<li>The Principle of Least Surprise<br />
</li>
<li>Keep It Simple Stupid<br />
</li>
<li>You Ain’t Gonne Need It<br />
</li>
<li>Don’t Repeat Yourself</li>
</ul>
</div>
<p><strong>Class Design</strong></p>
<ul>
<li>A class or interface should have a single purpose (AV1000)</li>
<li>An interface should be small and focused (AV1003)<br />
</li>
<li>Use an interface to decouple classes from each other (AV1005)<br />
</li>
<li>Don’t hide inherited members with the <code>new</code> keyword (AV1010)<br />
</li>
<li>It should be possible to treat a derived object as if it were a base class object (AV1011)<br />
</li>
<li>Don’t refer to derived classes from the base class (AV1013)<br />
</li>
<li>Avoid exposing the objects an object depends on (AV1014)<br />
</li>
<li>Avoid bidirectional dependencies (AV1020)<br />
</li>
<li>Classes should have state and behavior (AV1025)</li>
</ul>
<p><br /> <strong>Member Design</strong></p>
<ul>
<li>Allow properties to be set in any order (AV1100)<br />
</li>
<li>Don’t use mutual exclusive properties (AV1110)<br />
</li>
<li>A method or property should do only one thing (AV1115)<br />
</li>
<li>Don’t expose stateful objects through static members (AV1125)<br />
</li>
<li>Return an <code>IEnumerable&lt;T&gt;</code> or <code>ICollection&lt;T&gt;</code> instead of a concrete collection class (AV1130)<br />
</li>
<li>Properties, methods and arguments representing strings or collections should never be <code>null</code> (AV1135)<br />
</li>
<li>Define parameters as specific as possible (AV1137)<br />
</li>
</ul>
</td>
<td class="column">
<p><strong>Miscellaneous Design</strong></p>
<ul>
<li>Throw exceptions rather than returning status values (AV1200)<br />
</li>
<li>Provide a rich and meaningful exception message text (AV1202)<br />
</li>
<li>Don’t swallow errors by catching generic exceptions (AV1210)<br />
</li>
<li>Always check an event handler delegate for <code>null</code> (AV1220)<br />
</li>
<li>Properly handle exceptions in asynchronous code (AV1215)<br />
</li>
<li>Use a protected virtual method to raise each event (AV1225)<br />
</li>
<li>Don’t pass <code>null</code> as the sender parameter when raising an event (AV1235)<br />
</li>
<li>Use generic constraints if applicable (AV1240)<br />
</li>
<li>Evaluate the result of a LINQ expression before returning it (AV1250)</li>
</ul>
<p><br /> <strong>Maintainability</strong></p>
<ul>
<li>Methods should not exceed 7 statements (AV1500)<br />
</li>
<li>Make all members <code>private</code> and types <code>internal</code> by default (AV1501)<br />
</li>
<li>Avoid conditions with double negatives (AV1502)<br />
</li>
<li>Don’t use &quot;magic numbers&quot; (AV1515)<br />
</li>
<li>Only use <code>var</code> when the type is very obvious (AV1520)<br />
</li>
<li>Declare and initialize variables as late as possible (AV1521)<br />
</li>
<li>Favor Object and Collection Initializers over separate statements (AV1523)<br />
</li>
<li>Don’t make explicit comparisons to <code>true</code> or <code>false</code> (AV1525)<br />
</li>
<li>Don’t change a loop variable inside a <code>for</code> or <code>foreach</code> loop (AV1530)<br />
</li>
<li>Avoid nested loops (AV1532)<br />
</li>
</ul>
</td>
<td class="column">
<ul>
<li>Always add a block after keywords such <code>if</code>, <code>else</code>, <code>while</code>, <code>for</code>, <code>foreach</code> and <code>case</code> (AV1535)<br />
</li>
<li>Always add a <code>default</code> block after the last <code>case</code> in a <code>switch</code> statement (AV1536)<br />
</li>
<li>Finish every <code>if</code>-<code>else</code>-<code>if</code>statement with an <code>else</code>-part (AV1537)<br />
</li>
<li>Be reluctant with multiple <code>return</code> statements (AV1540)<br />
</li>
<li>Don’t use <code>if</code>-<code>else</code> statements instead of a simple (conditional) assignment (AV1545)<br />
</li>
<li>Encapsulate complex expressions in a method or property (AV1547)<br />
</li>
<li>Call the most overloaded method from other overloads (AV1551)<br />
</li>
<li>Only use optional arguments to replace overloads (AV1553)<br />
</li>
<li>Avoid using named arguments (AV1555)<br />
</li>
<li>Don’t allow methods and constructors with more than three parameters (AV1561)<br />
</li>
<li>Don’t use <code>ref</code> or <code>out</code> parameters (AV1562)<br />
</li>
<li>Avoid methods that take a <code>bool</code> flag (AV1564)<br />
</li>
<li>Always check the result of an <code>as</code> operation (AV1570)<br />
</li>
<li>Don’t comment-out code (AV1575)</li>
</ul>
<p><br /> <strong>Framework Guidelines</strong></p>
<ul>
<li>Use C# type aliases instead of the types from the <code>System</code> namespace (AV2201)<br />
</li>
<li>Build with the highest warning level (AV2210)<br />
</li>
<li>Use Lambda expressions instead of delegates (AV2221)<br />
</li>
<li>Only use the <code>dynamic</code> keyword when talking to a dynamic object (AV2230)<br />
</li>
<li>Favor <code>async</code>/<code>await</code> over the <code>Task</code> (AV2235)<br />
</li>
</ul>
</td>
<tr>
<table width="100%" class="footer">
<tr>
<td>
Dennis Doomen<br />
Version 5.0.0 (October 18, 2016)
</td>
<td style="text-align:right">
<a href="http://www.csharpcodingguidelines.com">www.csharpcodingguidelines.com</a><br />
<a href="www.continuousimprover.com" class="uri">www.continuousimprover.com</a><br />
<a href="http://www.avivasolutions.nl">www.avivasolutions.nl</a>
</td>
</tr>
</table>
<table width="100%" style="page-break-before: always;">
<tr>
<td class="title">
Coding Guidelines for C# 3.0, 4.0 and 5.0 Cheat Sheet
</td>
<td rowspan="2" style="text-align:right">
<img src="" alt="logo" />
</td>
</tr>
<tr>
<td>
<div class="subTitle">
Naming &amp; Layout
</div>
(level 1 and 2 only)
</td>
</tr>
</table>
<table width="100%">
<tr>
<td class="column">
<div class="sidebar">
<table>
<thead>
<tr class="header">
<th align="left"><strong>Pascal Casing</strong></th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">Class, Struct</td>
<td><code>AppDomain</code></td>
</tr>
<tr class="even">
<td align="left">Interface</td>
<td><code>IBusinessService</code></td>
</tr>
<tr class="odd">
<td align="left">Enumeration type</td>
<td><code>ErrorLevel</code></td>
</tr>
<tr class="even">
<td align="left">Enumeratiion values</td>
<td><code>FatalError</code></td>
</tr>
<tr class="odd">
<td align="left">Event</td>
<td><code>Click</code></td>
</tr>
<tr class="even">
<td align="left">Protected field</td>
<td><code>MainPanel</code></td>
</tr>
<tr class="odd">
<td align="left">Const field</td>
<td><code>MaximumItems</code></td>
</tr>
<tr class="even">
<td align="left">Read-only static field  </td>
<td><code>RedValue</code></td>
</tr>
<tr class="odd">
<td align="left">Method</td>
<td><code>ToString</code></td>
</tr>
<tr class="even">
<td align="left">Namespace</td>
<td><code>System.Drawing</code></td>
</tr>
<tr class="odd">
<td align="left">Property</td>
<td><code>BackColor</code></td>
</tr>
<tr class="even">
<td align="left">Type Parameter</td>
<td><code>TEntity</code></td>
</tr>
<tr class="odd">
<td align="left"></td>
<td></td>
</tr>
<tr class="even">
<td align="left"><br /><strong>Camel Casing</strong></td>
<td></td>
</tr>
<tr class="odd">
<td align="left">Private field</td>
<td><code>listItem</code></td>
</tr>
<tr class="even">
<td align="left">Variable</td>
<td><code>listOfValues</code></td>
</tr>
<tr class="odd">
<td align="left">Const variable</td>
<td><code>maximumItems</code></td>
</tr>
<tr class="even">
<td align="left">Parameter</td>
<td><code>typeName</code></td>
</tr>
</tbody>
</table>
</div>
<p><br /> <strong>Naming</strong></p>
<ul>
<li>Use US English (AV1701)</li>
<li>Don’t include numbers in variables, parameters and type members (AV1704)</li>
<li>Don’t prefix fields (AV1705)</li>
<li>Don’t use abbreviations (AV1706)</li>
<li>Name members, parameters or variables according its meaning and not its type (AV1707)</li>
<li>Name types using nouns, noun phrases or adjective phrases (AV1708)</li>
<li>Don’t repeat the name of a class or enumeration in its members (AV1710)</li>
<li>Avoid short names or names that can be mistaken with other names (AV1712)</li>
<li>Name methods using verb-object pair (AV1720)</li>
<li>Name namespaces using names, layers, verbs and features (AV1725)</li>
</ul>
</td>
<td class="column">
<ul>
<li>Use an underscore for irrelevant lambda parameters (AV1739)</li>
</ul>
<p><strong>Documentation</strong></p>
<ul>
<li>Write comments and documentation in US English (AV2301)</li>
<li>Document all public, protected and internal types and members (AV2305)</li>
<li>Avoid inline comments (AV2310)</li>
<li>Only write comments to explain complex algorithms or decisions (AV2316)</li>
<li>Don’t use comments for tracking work to be done later (AV2318) <br /></li>
</ul>
<p><strong>Layout</strong></p>
<ul>
<li>Maximum line length is 130 characters.</li>
<li>Indent 4 spaces, don’t use Tabs</li>
<li>Keep one white-space between keywords like <code>if</code> and the expression, but don’t add white-spaces after <code>(</code> and before <code>)</code>.</li>
<li>Add a white-space around operators, like <code>+</code>, <code>-</code>, <code>==</code>, etc.</li>
<li>Always add parentheses after keywords <code>if</code>, <code>else</code>, <code>do</code>, <code>while</code>, <code>for</code> and <code>foreach</code></li>
<li>Always put opening and closing parentheses on a new line.</li>
<li>Don’t indent object initializers and initialize each property on a new line.</li>
<li>Don’t indent lambda statements</li>
<li>Put the entire LINQ statement on one line, or start each keyword at the same indentation.</li>
<li>Add braces around comparison conditions, but don’t add braces around a singular condition.</li>
</ul>
</td>
<td class="column">
<div class="sidebar" markdown="1">
<p><strong>Empty lines</strong></p>
<ul>
<li>Between members</li>
<li>After the closing parentheses</li>
<li>Between multi-line statements</li>
<li>Between unrelated code blocks</li>
<li>Around the <code>#region</code> keyword</li>
<li>Between the <code>using</code> statements of different root namespaces.</li>
</ul>
</div>
<div class="sidebar">
<p><strong>Member order</strong></p>
<ol style="list-style-type: decimal">
<li>Private fields and constants</li>
<li>Public constants</li>
<li>Public read-only static fields</li>
<li>Factory Methods</li>
<li>Constructors and the Finalizer</li>
<li>Events</li>
<li>Public Properties</li>
<li>Other methods and private properties in calling order</li>
</ol>
</div>
<div class="sidebar" markdown="1">
<p><strong>Important Note</strong></p>
<p>These coding guidelines are an extension to Visual Studio's Code Analysis functionalty, so make sure you enable that for all your projects. Check the full document for more details.</p>
</div>
<td></td>
<tr>
<table width="100%" class="footer">
<tr>
<td>
Dennis Doomen<br />
Version 5.0.0 (October 18, 2016)<br />

</td>
<td style="text-align:right">
<a href="http://www.csharpcodingguidelines.com">www.csharpcodingguidelines.com</a><br />
<a href="www.continuousimprover.com" class="uri">www.continuousimprover.com</a><br />
<a href="http://www.avivasolutions.nl">www.avivasolutions.nl</a><br />

</td>
</tr>
</table>
</body>
</html>
